 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>参数配置</title>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/main.css" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script>
<script type='text/javascript' src="<%=request.getContextPath()%>/dwr/interface/BankDwr.js"></script>
  </head>
  <script type="text/javascript">
  function check(){
  document.getElementById('btn').disabled=false;
  }
  function edit(){
        x=document.getElementById('rcom').value;
		y=document.getElementById('pcom').value;
		if(x=="" || y==""){
		alert("串口号不能为空");
		window.location.href="wroleAction!sysini.action";
		return false;
		}
        BankDwr.editini(x,y,function(data){
			if(data=="") {
				alert("处理成功！重新登录后生效");
				document.getElementById('btn').disabled=true;
			}else {
				alert("提示！"+data);
				window.location.href="wroleAction!sysini.action";
			}
		});
	}
  </script>
  <body>
  <div align="center" style="margin-top: 5px;">
    <table cellspacing="0" width="95%">
    <tr>
  		<td colspan="6">当前位置:&nbsp;&nbsp; <a href="#">系统设置</a>&nbsp;>>&nbsp;<a href="#">参数管理</a><a href="#">&gt;&gt;</a></td>
  	</tr>
    </table>
  </div>
  <div align="center" style="margin-top: 5px;">
 		<form name="myform" action="" method="post">
 		 <table cellspacing="0" width="95%">
 		 <tr>
 		 <td>[Server]</td>
 		 <td>后台处理中心</td>
 		 </tr>
 		 <tr>
 		 <td>IP</td>
 		 <td><input type="text" name="IP" id="IP" value="<s:property value='config.IP'/>" disabled="disabled"/></td>
 		 </tr>
 		  <td>端口号</td>
 		 <td><input type="text" name="port" id="port" value="<s:property value="config.port"/>" disabled="disabled"/></td>
 		 </tr>
 		  <tr>
 		 <td>[Reader]</td>
 		 <td>卡读写器</td>
 		 </tr>
 		 <tr>
 		 <td>类型</td>
 		 <td><input type="text" name="rtype" id="rtype" value="<s:property value="config.rtype"/>" disabled="disabled"/></td>
 		 </tr>
 		  <td>串口号</td>
 		 <td><input type="text"  name="rcom" id="rcom" value="<s:property value="config.rcom"/>" onkeypress="check()"/></td>
 		 </tr>
 		   <tr>
 		 <td>[OBU]</td>
 		 <td>OBU发行器</td>
 		 </tr>
 		 <tr>
 		 <td>类型</td>
 		 <td><input type="text" name="ptype" id="ptype" <s:if test="config.ptype==0">value="金益发行器" </s:if> disabled="disabled" /></td>
 		 </tr>
 		  <td>设备类型</td>
 		 <td><input type="text" name="progHand" id="progHand" <s:if test="config.progHand==0">value="台式设备"</s:if>
 		 <s:if test="config.progHand==1">value="手持设备"</s:if> disabled="disabled"
 		  /></td>
 		 </tr>
 		 <td>串口号</td>
 		 <td><input type="text" name="pcom" id="pcom" value="<s:property value="config.pcom"/>" onkeypress="check()"/></td>
 		 </tr>
 		  </table>
 		  <input type="button" id="btn" class="btn7" value="更改" onclick="edit()" disabled="disabled"/>
 		</form>
  </div>
  </body>
  </html>
